<script type='text/javascript'>
        $(function(){
			end();
		})
		function end() {
			new QRCode(document.getElementById('end'), {
				width: 100,
				height: 100,
				text: 'end',
				colorDark: '#000000',
				colorLight: '#ffffff',
				correctLevel: QRCode.CorrectLevel.H
			});
			new QRCode(document.getElementById('submit'), {
				width: 100,
				height: 100,
				text: 'submit',
				colorDark: '#000000',
				colorLight: '#ffffff',
				correctLevel: QRCode.CorrectLevel.H
			});
			new QRCode(document.getElementById('flash'), {
				width: 100,
				height: 100,
				text: 'flash',
				colorDark: '#000000',
				colorLight: '#ffffff',
				correctLevel: QRCode.CorrectLevel.H
			});
			new QRCode(document.getElementById('back'), {
				width: 100,
				height: 100,
				text: 'back',
				colorDark: '#000000',
				colorLight: '#ffffff',
				correctLevel: QRCode.CorrectLevel.H
			});
		}

		function commFun(v,param){
        	var robot_id = "{{getSession('robot_id')}}"
            if(v.toLowerCase()=='end'){
            	parent.layer.closeAll('iframe');
                // location.href = "index.html?data="+robot_id
                return true;
            }
		    if(v.toLowerCase()=='submit'){
				try{
					submit();
				}catch (e) {
					return false;
				}
                return true;
            }
		    if(v.toLowerCase()=='flash'){
                location.reload();
                return true;
            }
		    // if(v.toLowerCase()=='back'){
            //     history.back();
            //     return true;
            // }
		    return false;
        }
	</script>
</html>
